package com.example.tarea2;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class MainActivity extends Activity {
	
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
	
		//Creamos la cadena para el saludo
		final TextView textSaludo = (TextView)findViewById(R.id.textSaludo);
		final Bundle b = this.getIntent().getExtras();	
		//se construye el mensaje a mostrar
		textSaludo.setText("Hola, " + b.getString("Nombre"));
	
	final Button boton = (Button)findViewById(R.id.button1);
	
	boton.setOnClickListener(new View.OnClickListener() {
		@Override
		public void onClick(View v) {
			// TODO Auto-generated method stub
			Intent intencion = new Intent(MainActivity.this, spinner.class);
			startActivity(intencion);
		}
	});
	
	final Button boton1 = (Button)findViewById(R.id.button2);
		
		boton1.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intencion = new Intent(MainActivity.this, listview.class);
				startActivity(intencion);
			}
		});
	
	final Button boton2 = (Button)findViewById(R.id.button3);
		
		boton2.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intencion = new Intent(MainActivity.this, gridview.class);
				startActivity(intencion);
			}
		});
		
final Button boton4 = (Button)findViewById(R.id.button5);
		
		boton4.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent intencion = new Intent(MainActivity.this, controlPer1.class);
				startActivity(intencion);
			}
		});

		
	}
}
